<script setup>
import { ref } from 'vue';

const form = ref({
  courseName: '',
  courseDescription: ''
});

const onSubmit = () => {
  console.log('提交表单:', form.value);
  // 这里可以添加提交表单的逻辑，例如调用 API 或处理表单数据
};
</script>

<template>
  <el-form :model="form" label-width="120px">
    <el-form-item label="课程名">
      <el-input v-model="form.courseName" placeholder="请输入课程名"></el-input>
    </el-form-item>

    <el-form-item label="课程简介">
      <el-input
        v-model="form.courseDescription"
        type="textarea"
        placeholder="请输入课程简介"
      ></el-input>
    </el-form-item>

    <el-form-item>
      <el-button type="primary" @click="onSubmit">添加</el-button>
    </el-form-item>
  </el-form>
</template>

<style scoped>
/* 你可以在这里添加样式 */
</style>
